Page({
  data: {
    isDarkMode: false
  },
  onShow() {
    const isDark = wx.getStorageSync('isDarkMode');
    this.setData({
      isDarkMode: typeof isDark === 'boolean' ? isDark : (getApp().globalData.isDarkMode || false)
    });
  },
  updateTheme(isDark) {
    this.setData({ isDarkMode: isDark });
  }
}); 